﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using BooruViewer.Annotations;

namespace BooruViewer.Models
{
    public class BImage : INotifyPropertyChanged
    {
        public string Id { get; set; }
        public string Thumb { get; set; }
        public string FullImage { get; set; }
        public string[] Artists { get; set; }
        public string[] Tags { get; set; }
        public string Extension { get; set; }
        public long Score { get; set; }

        /// <summary>
        /// Constructor for BImage object
        /// </summary>
        /// <param name="id"></param>
        /// <param name="thumb"></param>
        /// <param name="fullImage"></param>
        /// <param name="artists"></param>
        /// <param name="tags"></param>
        /// <param name="extension"></param>
        /// <param name="score"></param>
        public BImage(string id, string thumb, string fullImage, string[] artists, string[] tags, string extension, long score)
        {
            Id = id;
            Thumb = extension != "webm" ? thumb : "imgs/webm.png";
            FullImage = fullImage;
            Artists = artists;
            Tags = tags;
            Extension = extension;
            Score = score;
        }

        public event PropertyChangedEventHandler PropertyChanged;

        /// <summary>
        /// INotifyPropertyChanged implementation
        /// </summary>
        /// <param name="propertyName"></param>
        [NotifyPropertyChangedInvocator]
        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
